m = list(map(int, input().split()))
n = int(input())
for i in range(len(m)):
    for j in range(i + 1, len(m)):
        if m[i] + m[j] == n:
            print(sorted([m[i], m[j]], reverse=False)[0],
                         sorted([m[i], m[j]], reverse=False)[1])
            ...
